﻿Imports System.ComponentModel
Imports System.Reflection

Public Class frmNavigate

    '定义一个dictionary,用来存放每个标题按钮对应的flowlayoutpanel
    'Private btnTitleDic As Dictionary(Of String, Object)
    '定义一个dictionary，用来存放每个具体工具对应的窗体类的类型 - 
    'Private btnItemDic As Dictionary(Of String, Type)

    Private Sub frmNavigate_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        '加载菜单条目
        LoadNavItems()

    End Sub

    Private Sub LoadNavItems()

        '定义标题按钮的对象词典
        sysBtnTitleDic = New Dictionary(Of String, Object)
        sysBtnItemDic = New Dictionary(Of String, Type)


        '添加账套相关的按钮组
        '如果当前有账套，则生成当前账套数据库连接字串，并添加相应按钮组
        If sysCurrentClsLedger IsNot Nothing Then
            '当前账套的数据库访问字串
            If String.IsNullOrEmpty(sysUserDataConnectionString) Then
                'sysUserDataConnectionString = IO.Path.Combine(IO.Path.Combine(sysAppCurrentPath, APP_DATA_PATH), sysCurrentClsLedger.LedgerDataRealPath)
                Dim tmpPath As String = IO.Path.Combine(IO.Path.Combine(sysAppCurrentPath, APP_DATA_PATH), sysCurrentClsLedger.LedgerDataRealPath)
                'sysUserDataConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & tmpPath & ";Persist Security Info=True"
                sysUserDataConnectionString = String.Format(sysConnectionTemplate, tmpPath)
            End If
            '添加相应操作按钮组
            LoadNormalButtonGroup()
        End If

        '如果当前用户有管理权限，则添加系统管理按钮组
        If sysCurrentClsUser.UserIfAdmin Then
            LoadSysManageButtonGroup()
        End If
    End Sub

    Private Sub LoadNormalButtonGroup()

        '================================================
        '001 - 生成第一个标题按钮
        '================================================
        '添加第一组按钮标签 凭证处理:
        '01 - 定义分组布局
        Dim panelVoucher As FlowLayoutPanel = New FlowLayoutPanel()
        panelVoucher.Anchor = AnchorStyles.Left Or AnchorStyles.Top
        '02 - 定义标题按钮标签
        Dim btnTitleVoucher As NavTitleButton = New NavTitleButton()
        '03 - 设置标题按钮标签属性
        With btnTitleVoucher
            .Text = NAV_TITLE_VOUCHER_TEXT  '"凭证处理"
            .Image = My.Resources.nav_title_bg_voucher  'Image.FromFile(IO.Path.Combine(IO.Path.Combine(sysAppCurrentPath, "pic"), "nav_title_bg_voucher.png"))
            .Tag = NAV_TITLE_VOUCHER_TAG '"TitleVoucher"
        End With
        '04 - 添加点击事件
        AddHandler btnTitleVoucher.Click, AddressOf ShowAndHideGroup
        '05 - 放入词典
        sysBtnTitleDic.Add(NAV_TITLE_VOUCHER_TAG, panelVoucher)

        '06 - 将按钮标题加入到窗体控件中
        Me.FlowLayoutPanel1.Controls.Add(btnTitleVoucher) ' 001
        '07 - 将布局栏目组控件加入到窗体控件中
        Me.FlowLayoutPanel1.Controls.Add(panelVoucher)

        '=========================================================
        '08 - 开始添加组内各栏目按钮 共 11 个
        '0801 - 录入本月凭证 栏目
        '1--添加具体按钮 - 录入本月凭证
        Dim btnInputVoucher As NavItemButton = New NavItemButton() 'Button = New Button
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_INPUT_VOUCHER_TAG, GetType(FrmVoucherInput))

        '3--设置属性
        With btnInputVoucher
            .Tag = NAV_ITEM_INPUT_VOUCHER_TAG  '"ItemInputVoucher"
            .Text = NAV_ITEM_INPUT_VOUCHER_TEXT  '"录入本月凭证"
        End With
        '4--添加按钮点击事件
        AddHandler btnInputVoucher.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelVoucher.Controls.Add(btnInputVoucher) '01

        '0802 - 录入本月凭证 栏目添加修改凭证栏目条
        '1---生成条目按钮 - 修改凭证
        Dim btnEditVoucher As NavItemButton = New NavItemButton()
        '2---添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_EDIT_VOUCHER_TAG, GetType(frmVoucherEdit))
        '3---设置按钮属性
        With btnEditVoucher
            .Tag = NAV_ITEM_EDIT_VOUCHER_TAG  '"ItemEditVoucher"
            .Text = NAV_ITEM_EDIT_VOUCHER_TEXT   '"修改凭证"
        End With
        '4---添加按钮点击事件
        AddHandler btnEditVoucher.Click, AddressOf OpenButtonItemForm
        '5---添加条目按钮到panel控件组中
        panelVoucher.Controls.Add(btnInputVoucher) '02

        '0803 - 添加审核凭证栏目条
        '1---生成条目按钮 - 审核凭证
        Dim btnCheckupVoucher As NavItemButton = New NavItemButton()
        '2---添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_CHECKUP_VOUCHER_TAG, GetType(frmVoucherCheckup))
        '3---设置按钮属性
        With btnCheckupVoucher
            .Tag = NAV_ITEM_CHECKUP_VOUCHER_TAG  '"ItemCheckupVoucher"
            .Text = NAV_ITEM_CHECKUP_VOUCHER_TEXT   '"审核凭证"
        End With
        '4---添加按钮点击事件
        AddHandler btnCheckupVoucher.Click, AddressOf OpenButtonItemForm
        '5---添加条目按钮到panel控件组中
        panelVoucher.Controls.Add(btnCheckupVoucher) '03

        '0804 - 添加删除凭证栏目条
        '1---生成条目按钮 - 删除凭证
        Dim btnDeleteVoucher As NavItemButton = New NavItemButton()
        '2---添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_DELETE_VOUCHER_TAG, GetType(frmVoucherDelete))
        '3---设置按钮属性
        With btnDeleteVoucher
            .Tag = NAV_ITEM_DELETE_VOUCHER_TAG  '"ItemDeleteVoucher"
            .Text = NAV_ITEM_DELETE_VOUCHER_TEXT   '"删除凭证"
        End With
        '4---添加按钮点击事件
        AddHandler btnDeleteVoucher.Click, AddressOf OpenButtonItemForm
        '5---添加条目按钮到panel控件组中
        panelVoucher.Controls.Add(btnDeleteVoucher) '04

        '0805 - 添加浏览打印凭证栏目条
        '1---生成条目按钮 - 从锐剑账务导入凭证
        Dim btnBrowseVoucher As NavItemButton = New NavItemButton()
        '2---添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_BROWSE_VOUCHER_TAG, GetType(frmVoucherBrowse))
        '3---设置按钮属性
        With btnBrowseVoucher
            .Tag = NAV_ITEM_BROWSE_VOUCHER_TAG  '"ItemBrowseVoucher"
            .Text = NAV_ITEM_BROWSE_VOUCHER_TEXT   '"浏览打印凭证"
        End With
        '4---添加按钮点击事件
        AddHandler btnBrowseVoucher.Click, AddressOf OpenButtonItemForm
        '5---添加条目按钮到panel控件组中
        panelVoucher.Controls.Add(btnBrowseVoucher) '05


        '0806 - 添加查找凭证栏目条
        '1---生成条目按钮 - 从锐剑账务导入凭证
        Dim btnLookupVoucher As NavItemButton = New NavItemButton()
        '2---添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_LOOKUP_VOUCHER_TAG, GetType(frmVoucherLookup))
        '3---设置按钮属性
        With btnLookupVoucher
            .Tag = NAV_ITEM_LOOKUP_VOUCHER_TAG  '"ItemLookupVoucher"
            .Text = NAV_ITEM_LOOKUP_VOUCHER_TEXT   '"查找凭证"
        End With
        '4---添加按钮点击事件
        AddHandler btnLookupVoucher.Click, AddressOf OpenButtonItemForm
        '5---添加条目按钮到panel控件组中
        panelVoucher.Controls.Add(btnLookupVoucher) '06

        '0807 - 添加检修凭证栏目条
        '1---生成条目按钮 - 从锐剑账务导入凭证
        Dim btnRepairVoucher As NavItemButton = New NavItemButton()
        '2---添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_REPAIR_VOUCHER_TAG, GetType(frmVoucherRepair))
        '3---设置按钮属性
        With btnRepairVoucher
            .Tag = NAV_ITEM_REPAIR_VOUCHER_TAG  '"ItemRepairVoucher"
            .Text = NAV_ITEM_REPAIR_VOUCHER_TEXT   '"检修凭证"
        End With
        '4---添加按钮点击事件
        AddHandler btnRepairVoucher.Click, AddressOf OpenButtonItemForm
        '5---添加条目按钮到panel控件组中
        panelVoucher.Controls.Add(btnRepairVoucher) '07

        '0808 - 添加从锐剑账务导入凭证栏目条
        '1---生成条目按钮 - 从锐剑账务导入凭证
        Dim btnInputFromRjcwVoucher As NavItemButton = New NavItemButton()
        '2---添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_INPUTFROMRJCW_VOUCHER_TAG, GetType(frmVoucherInputFromRJCW))
        '3---设置按钮属性
        With btnInputFromRjcwVoucher
            .Tag = NAV_ITEM_INPUTFROMRJCW_VOUCHER_TAG  '"ItemDeleteVoucher"
            .Text = NAV_ITEM_INPUTFROMRJCW_VOUCHER_TEXT   '"导入凭证 - 从锐剑系统"
        End With
        '4---添加按钮点击事件
        AddHandler btnInputFromRjcwVoucher.Click, AddressOf OpenButtonItemForm
        '5---添加条目按钮到panel控件组中
        panelVoucher.Controls.Add(btnInputFromRjcwVoucher) '08

        '0809 - 添加从Excel文件导入凭证栏目条
        '1---生成条目按钮 - 从锐剑账务导入凭证
        Dim btnInputFromExcel As NavItemButton = New NavItemButton()
        '2---添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_INPUTFROMEXCEL_VOUCHER_TAG, GetType(frmVoucherInputFromExcel))
        '3---设置按钮属性
        With btnInputFromExcel
            .Tag = NAV_ITEM_INPUTFROMEXCEL_VOUCHER_TAG  '"ItemRepairVoucher"
            .Text = NAV_ITEM_INPUTFROMEXCEL_VOUCHER_TEXT   '"从Excel文件导入凭证"
        End With
        '4---添加按钮点击事件
        AddHandler btnInputFromExcel.Click, AddressOf OpenButtonItemForm
        '5---添加条目按钮到panel控件组中
        panelVoucher.Controls.Add(btnInputFromExcel) '09

        '0810 - 添加从Excel文件生成栏目条
        '1---生成条目按钮 - 从锐剑账务导入凭证
        Dim btnInputGenExcel As NavItemButton = New NavItemButton()
        '2---添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_INPUTGENEXCEL_VOUCHER_TAG, GetType(frmVoucherGenFromExcel))
        '3---设置按钮属性
        With btnInputGenExcel
            .Tag = NAV_ITEM_INPUTGENEXCEL_VOUCHER_TAG  '"ItemInputGenExcelVoucher"
            .Text = NAV_ITEM_INPUTGENEXCEL_VOUCHER_TEXT   '"从Excel文件生成"
        End With
        '4---添加按钮点击事件
        AddHandler btnInputGenExcel.Click, AddressOf OpenButtonItemForm
        '5---添加条目按钮到panel控件组中
        panelVoucher.Controls.Add(btnInputGenExcel) '10


        '0811 - 添加导出凭证栏目条
        '1---生成条目按钮 - 导出凭证
        Dim btnOutupToExcelVoucher As NavItemButton = New NavItemButton()
        '2---添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_OUTPUTTOEXCEL_VOUCHER_TAG, GetType(frmVoucherOutpuToExcel))
        '3---设置按钮属性
        With btnOutupToExcelVoucher
            .Tag = NAV_ITEM_OUTPUTTOEXCEL_VOUCHER_TAG  '"ItemOutputToExcelVoucher"
            .Text = NAV_ITEM_OUTPUTTOEXCEL_VOUCHER_TEXT   '"导出凭证"
        End With
        '4---添加按钮点击事件
        AddHandler btnOutupToExcelVoucher.Click, AddressOf OpenButtonItemForm
        '5---添加条目按钮到panel控件组中
        panelVoucher.Controls.Add(btnOutupToExcelVoucher) '11

        '09 - 调整栏目组容器控件panel高度
        panelVoucher.AutoSize = True
        '10 - 设定容器控件的隐藏（折叠）
        panelVoucher.Visible = False

        '********************
        '凭证过账、本月结账、本月反过账/反结账、科目汇总表、科目金额余额表、科目数量余额表、科目外币余额表、
        '模拟过账、本月自动损益结转、科目明细账、科目总账、财务报表、定义多栏账、科目多栏账、组合明细账
        '================================================
        '002 - 生成第二个标题按钮 账簿处理:
        '================================================
        '
        '01 - 定义分组布局
        Dim panelLedger As FlowLayoutPanel = New FlowLayoutPanel()
        panelLedger.Anchor = AnchorStyles.Left Or AnchorStyles.Top
        '02 - 定义标题按钮标签
        Dim btnTitleLedger As NavTitleButton = New NavTitleButton()
        '03 - 设置标题按钮标签属性
        With btnTitleLedger
            .Text = NAV_TITLE_LEDGER_TEXT  '"账簿处理"
            .Image = My.Resources.nav_title_bg_ledger  'Image.FromFile(IO.Path.Combine(IO.Path.Combine(sysAppCurrentPath, "pic"), "nav_title_bg_ledger.png"))
            .Tag = NAV_TITLE_LEDGER_TAG '"TitleLedgerer"
        End With
        '04 - 添加点击事件
        AddHandler btnTitleLedger.Click, AddressOf ShowAndHideGroup
        '05 - 放入词典
        sysBtnTitleDic.Add(NAV_TITLE_LEDGER_TAG, panelLedger)

        '06 - 将按钮标题加入到窗体控件中
        Me.FlowLayoutPanel1.Controls.Add(btnTitleLedger) ' 001
        '07 - 将布局栏目组控件加入到窗体控件中
        Me.FlowLayoutPanel1.Controls.Add(panelLedger)

        '=========================================================
        '08 - 开始添加组内各栏目按钮 共 9 个
        '0801 - 凭证过账 栏目
        '1--添加具体按钮 - 凭证过账
        Dim btnPostVoucher As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_POST_VOUCHER_TAG, GetType(frmVoucherPost))

        '3--设置属性
        With btnPostVoucher
            .Tag = NAV_ITEM_POST_VOUCHER_TAG  '"ItemInputVoucher"
            .Text = NAV_ITEM_POST_VOUCHER_TEXT  '"凭证过账"
        End With
        '4--添加按钮点击事件
        AddHandler btnPostVoucher.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelLedger.Controls.Add(btnPostVoucher) '01


        '0802 - 本月结账 栏目
        '1--添加具体按钮 - 本月结账
        Dim btnSettleMonthLedger As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_SETTLEMONTH_LEDGER_TAG, GetType(frmLedgerSettleMonth))

        '3--设置属性
        With btnSettleMonthLedger
            .Tag = NAV_ITEM_SETTLEMONTH_LEDGER_TAG  '"ItemSettleMonthLedger"
            .Text = NAV_ITEM_SETTLEMONTH_LEDGER_TEXT  '"本月结账"
        End With
        '4--添加按钮点击事件
        AddHandler btnSettleMonthLedger.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelLedger.Controls.Add(btnSettleMonthLedger) '02


        '0803 - 本月反过账/反结账 栏目
        '1--添加具体按钮 - 本月反过账/反结账
        Dim btnUnPostLedger As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_UNPOST_LEDGER_TAG, GetType(frmLedgerUnPost))

        '3--设置属性
        With btnUnPostLedger
            .Tag = NAV_ITEM_UNPOST_LEDGER_TAG  '"ItemUnPostLedger"
            .Text = NAV_ITEM_UNPOST_LEDGER_TEXT  '"本月反过账/反结账"
        End With
        '4--添加按钮点击事件
        AddHandler btnUnPostLedger.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelLedger.Controls.Add(btnUnPostLedger) '03

        '0804 - 科目汇总表 栏目
        '1--添加具体按钮 - 科目汇总表
        Dim btnSumAccountLedger As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_SUMACCOUNT_LEDGER_TAG, GetType(frmLedgerSumAccount))

        '3--设置属性
        With btnSumAccountLedger
            .Tag = NAV_ITEM_SUMACCOUNT_LEDGER_TAG  '"ItemUnPostLedger"
            .Text = NAV_ITEM_SUMACCOUNT_LEDGER_TEXT  '"科目汇总表"
        End With
        '4--添加按钮点击事件
        AddHandler btnSumAccountLedger.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelLedger.Controls.Add(btnSumAccountLedger) '04

        '0805 - 科目金额余额表 栏目
        '1--添加具体按钮 - 科目金额余额表
        Dim btnAccountBalanceLedger As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_ACCOUNTBALANCE_LEDGER_TAG, GetType(frmLedgerAccountBalance))

        '3--设置属性
        With btnAccountBalanceLedger
            .Tag = NAV_ITEM_ACCOUNTBALANCE_LEDGER_TAG  '"ItemAccountBalanceLedger"
            .Text = NAV_ITEM_ACCOUNTBALANCE_LEDGER_TEXT  '"科目金额余额表"
        End With
        '4--添加按钮点击事件
        AddHandler btnAccountBalanceLedger.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelLedger.Controls.Add(btnAccountBalanceLedger) '05

        '0806 - 科目数量余额表 栏目
        '1--添加具体按钮 - 科目数量余额表
        Dim btnQuantityBalanceLedger As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_QUANTITYBALANCE_LEDGER_TAG, GetType(frmLedgerQuantityBalance))

        '3--设置属性
        With btnQuantityBalanceLedger
            .Tag = NAV_ITEM_QUANTITYBALANCE_LEDGER_TAG  '"ItemQuantityBalanceLedger"
            .Text = NAV_ITEM_QUANTITYBALANCE_LEDGER_TEXT  '"科目数量余额表"
        End With
        '4--添加按钮点击事件
        AddHandler btnQuantityBalanceLedger.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelLedger.Controls.Add(btnQuantityBalanceLedger) '06

        '0807 - 模拟过账 栏目
        '1--添加具体按钮 - 模拟过账
        Dim btnFakePostLedger As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_FAKEPOST_LEDGER_TAG, GetType(frmLedgerFakePost))

        '3--设置属性
        With btnFakePostLedger
            .Tag = NAV_ITEM_FAKEPOST_LEDGER_TAG  '"ItemFakePostLedger"
            .Text = NAV_ITEM_FAKEPOST_LEDGER_TEXT  '"模拟过账"
        End With
        '4--添加按钮点击事件
        AddHandler btnFakePostLedger.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelLedger.Controls.Add(btnFakePostLedger) '07

        '0808 - 本月自动损益结转 栏目
        '1--添加具体按钮 - 本月自动损益结转
        Dim btnIncAndDecLedger As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_INCANDDEC_LEDGER_TAG, GetType(frmLedgerIncAndDec))

        '3--设置属性
        With btnIncAndDecLedger
            .Tag = NAV_ITEM_INCANDDEC_LEDGER_TAG  '"ItemIncAndDecLedger"
            .Text = NAV_ITEM_INCANDDEC_LEDGER_TEXT  '"本月自动损益结转"
        End With
        '4--添加按钮点击事件
        AddHandler btnIncAndDecLedger.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelLedger.Controls.Add(btnIncAndDecLedger) '08

        '09 - 调整栏目组容器控件panel高度
        panelLedger.AutoSize = True
        '10 - 设定容器控件的隐藏（折叠）
        panelLedger.Visible = False


        '********************
        '科目明细账、科目总账、财务报表、定义多栏账、科目多栏账、组合明细账
        '================================================
        '003 - 生成第三个标题按钮 报表处理:
        '================================================
        '
        '01 - 定义分组布局
        Dim panelReport As FlowLayoutPanel = New FlowLayoutPanel()
        panelReport.Anchor = AnchorStyles.Left Or AnchorStyles.Top
        '02 - 定义标题按钮标签
        Dim btnTitleReport As NavTitleButton = New NavTitleButton()
        '03 - 设置标题按钮标签属性
        With btnTitleReport
            .Text = NAV_TITLE_REPORT_TEXT  '"账簿处理"
            .Image = My.Resources.nav_title_bg_report  'Image.FromFile(IO.Path.Combine(IO.Path.Combine(sysAppCurrentPath, "pic"), "nav_title_bg_report.png"))
            .Tag = NAV_TITLE_REPORT_TAG '"TitleReport"
        End With
        '04 - 添加点击事件
        AddHandler btnTitleReport.Click, AddressOf ShowAndHideGroup
        '05 - 放入词典
        sysBtnTitleDic.Add(NAV_TITLE_REPORT_TAG, panelReport)

        '06 - 将按钮标题加入到窗体控件中
        Me.FlowLayoutPanel1.Controls.Add(btnTitleReport) ' 001
        '07 - 将布局栏目组控件加入到窗体控件中
        Me.FlowLayoutPanel1.Controls.Add(panelReport)

        '=========================================================
        '08 - 开始添加组内各栏目按钮 共 6 个
        '0801 - 科目明细账 栏目
        '1--添加具体按钮 - 科目明细账
        Dim btnAcctDetailReport As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_ACCTDETAIL_REPORT_TAG, GetType(frmReportAcctDetail))

        '3--设置属性
        With btnAcctDetailReport
            .Tag = NAV_ITEM_ACCTDETAIL_REPORT_TAG  '"ItemAcctDetailReport"
            .Text = NAV_ITEM_ACCTDETAIL_REPORT_TEXT  '"科目明细账"
        End With
        '4--添加按钮点击事件
        AddHandler btnAcctDetailReport.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelReport.Controls.Add(btnAcctDetailReport) '01

        '0802 - 科目总账 栏目
        '1--添加具体按钮 - 科目总账
        Dim btnGeneralLedgerReport As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_GENERALLEDGER_REPORT_TAG, GetType(frmReportGeneralLedger))

        '3--设置属性
        With btnGeneralLedgerReport
            .Tag = NAV_ITEM_GENERALLEDGER_REPORT_TAG  '"ItemGeneralLedgerReport"
            .Text = NAV_ITEM_GENERALLEDGER_REPORT_TEXT  '"科目总账报表"
        End With
        '4--添加按钮点击事件
        AddHandler btnGeneralLedgerReport.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelReport.Controls.Add(btnGeneralLedgerReport) '02

        '0803 - 标准财务报表 栏目
        '1--添加具体按钮 - 标准财务报表
        Dim btnFinancialStatementReport As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_FINANCIALSTATEMENT_REPORT_TAG, GetType(frmReportFinancialStatement))

        '3--设置属性
        With btnFinancialStatementReport
            .Tag = NAV_ITEM_FINANCIALSTATEMENT_REPORT_TAG  '"ItemFinancialStatementReport"
            .Text = NAV_ITEM_FINANCIALSTATEMENT_REPORT_TEXT  '"标准财务报表"
        End With
        '4--添加按钮点击事件
        AddHandler btnFinancialStatementReport.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelReport.Controls.Add(btnFinancialStatementReport) '03

        '0804 - 定义多栏账 栏目
        '1--添加具体按钮 - 定义多栏账
        Dim btnDefineMultiColumnReport As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_DEFINEMULTICOLUMN_REPORT_TAG, GetType(frmReportDefineMultiColumn))

        '3--设置属性
        With btnDefineMultiColumnReport
            .Tag = NAV_ITEM_DEFINEMULTICOLUMN_REPORT_TAG  '"ItemDefineMultiColumnReport"
            .Text = NAV_ITEM_DEFINEMULTICOLUMN_REPORT_TEXT  '"定义多栏账报表"
        End With
        '4--添加按钮点击事件
        AddHandler btnDefineMultiColumnReport.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelReport.Controls.Add(btnDefineMultiColumnReport) '04

        '0805 - 科目多栏账 栏目
        '1--添加具体按钮 - 科目多栏账
        Dim btnMultiColumnReport As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_MULTICOLUMN_REPORT_TAG, GetType(frmReportMultiColumn))

        '3--设置属性
        With btnMultiColumnReport
            .Tag = NAV_ITEM_MULTICOLUMN_REPORT_TAG  '"ItemMultiColumnReport"
            .Text = NAV_ITEM_MULTICOLUMN_REPORT_TEXT  '"科目多栏账报表"
        End With
        '4--添加按钮点击事件
        AddHandler btnMultiColumnReport.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelReport.Controls.Add(btnMultiColumnReport) '05

        '0806 - 组合明细账 栏目
        '1--添加具体按钮 - 组合明细账
        Dim btnComboColumnReport As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_COMBOCOLUMN_REPORT_TAG, GetType(frmReportComboColumn))

        '3--设置属性
        With btnComboColumnReport
            .Tag = NAV_ITEM_COMBOCOLUMN_REPORT_TAG  '"ItemComboColumnReport"
            .Text = NAV_ITEM_COMBOCOLUMN_REPORT_TEXT  '"组合明细账报表"
        End With
        '4--添加按钮点击事件
        AddHandler btnComboColumnReport.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelReport.Controls.Add(btnComboColumnReport) '06

        '09 - 调整栏目组容器控件panel高度
        panelReport.AutoSize = True
        '10 - 设定容器控件的隐藏（折叠）
        panelReport.Visible = False

        '********************
        '财务设置：科目设置、导入科目、科目修复、常用摘要、专项设置、凭证类别、全局打印设置
        '================================================
        '004 - 生成第四个标题按钮 财务设置:
        '================================================
        '
        '01 - 定义分组布局
        Dim panelFinancialSetup As FlowLayoutPanel = New FlowLayoutPanel()
        panelFinancialSetup.Anchor = AnchorStyles.Left Or AnchorStyles.Top
        '02 - 定义标题按钮标签
        Dim btnTitleFinancialSetup As NavTitleButton = New NavTitleButton()
        '03 - 设置标题按钮标签属性
        With btnTitleFinancialSetup
            .Text = NAV_TITLE_FINANCIAL_SETUP_TEXT '= "财务设置"
            .Image = My.Resources.nav_title_bg_global_setup  'Image.FromFile(IO.Path.Combine(IO.Path.Combine(sysAppCurrentPath, "pic"), "nav_title_bg_global_setup.png"))
            .Tag = NAV_TITLE_FINANCIAL_SETUP_TAG '"TitleFinancialSetup"
        End With
        '04 - 添加点击事件
        AddHandler btnTitleFinancialSetup.Click, AddressOf ShowAndHideGroup
        '05 - 放入词典
        sysBtnTitleDic.Add(NAV_TITLE_FINANCIAL_SETUP_TAG, panelFinancialSetup)

        '06 - 将按钮标题加入到窗体控件中
        Me.FlowLayoutPanel1.Controls.Add(btnTitleFinancialSetup) ' 001
        '07 - 将布局栏目组控件加入到窗体控件中
        Me.FlowLayoutPanel1.Controls.Add(panelFinancialSetup)

        '=========================================================
        '08 - 开始添加组内各栏目按钮 共 6 个
        '0801 - 科目设置 栏目
        '1--添加具体按钮 - 科目设置
        Dim btnAcctFinancialSetup As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_ACCT_FINANCIALSETUP_TAG, GetType(frmFinancialSetupAcct))

        '3--设置属性
        With btnAcctFinancialSetup
            .Tag = NAV_ITEM_ACCT_FINANCIALSETUP_TAG  '"ItemAcctFinancialSetup"
            .Text = NAV_ITEM_ACCT_FINANCIALSETUP_TEXT  '"科目设置"
        End With
        '4--添加按钮点击事件
        AddHandler btnAcctFinancialSetup.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelFinancialSetup.Controls.Add(btnAcctFinancialSetup) '01

        '0802 - 导入科目 栏目
        '1--添加具体按钮 - 导入科目
        Dim btnInputAcctFinancialSetup As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_INPUT_ACCT_FINANCIALSETUP_TAG, GetType(frmFinancialSetupInputAcct))

        '3--设置属性
        With btnInputAcctFinancialSetup
            .Tag = NAV_ITEM_INPUT_ACCT_FINANCIALSETUP_TAG  '"ItemInputAcctFinancialSetup"
            .Text = NAV_ITEM_INPUT_ACCT_FINANCIALSETUP_TEXT  '"导入科目"
        End With
        '4--添加按钮点击事件
        AddHandler btnInputAcctFinancialSetup.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelFinancialSetup.Controls.Add(btnInputAcctFinancialSetup) '02

        '0803 - 科目修复 栏目
        '1--添加具体按钮 - 科目修复
        Dim btnRepairAcctFinancialSetup As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_REPAIR_ACCT_FINANCIALSETUP_TAG, GetType(frmFinancialSetupRepairAcct))

        '3--设置属性
        With btnRepairAcctFinancialSetup
            .Tag = NAV_ITEM_REPAIR_ACCT_FINANCIALSETUP_TAG  '"ItemRepairAcctFinancialSetup"
            .Text = NAV_ITEM_REPAIR_ACCT_FINANCIALSETUP_TEXT  '"科目修复"
        End With
        '4--添加按钮点击事件
        AddHandler btnRepairAcctFinancialSetup.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelFinancialSetup.Controls.Add(btnRepairAcctFinancialSetup) '03

        '0804 - 专项设置 栏目
        '1--添加具体按钮 - 专项设置
        Dim btnSpecialProjectFinancialSetup As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_SPECIAL_PROJECT_FINANCIALSETUP_TAG, GetType(frmFinancialSetupSepcialProject))

        '3--设置属性
        With btnSpecialProjectFinancialSetup
            .Tag = NAV_ITEM_SPECIAL_PROJECT_FINANCIALSETUP_TAG  '"ItemSpecialProjectFinancialSetup"
            .Text = NAV_ITEM_SPECIAL_PROJECT_FINANCIALSETUP_TEXT  '"专项设置"
        End With
        '4--添加按钮点击事件
        AddHandler btnSpecialProjectFinancialSetup.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelFinancialSetup.Controls.Add(btnSpecialProjectFinancialSetup) '04

        '0805 - 凭证类别 栏目
        '1--添加具体按钮 - 凭证类别
        Dim btnVoutcherTypeFinancialSetup As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_VOUCHER_TYPE_FINANCIALSETUP_TAG, GetType(frmFinancialSetupVoucherType))
        '3--设置属性
        With btnVoutcherTypeFinancialSetup
            .Tag = NAV_ITEM_VOUCHER_TYPE_FINANCIALSETUP_TAG  '"ItemVoucherTypeFinancialSetup"
            .Text = NAV_ITEM_VOUCHER_TYPE_FINANCIALSETUP_TEXT  '"凭证类别"
        End With
        '4--添加按钮点击事件
        AddHandler btnVoutcherTypeFinancialSetup.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelFinancialSetup.Controls.Add(btnVoutcherTypeFinancialSetup) '05

        '0806 - 全局打印设置 栏目
        '1--添加具体按钮 - 全局打印设置
        Dim btnGlobalPrintFinancialSetup As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_GLOBAL_PRINT_FINANCIALSETUP_TAG, GetType(frmFinancialSetupGlobalPrint))
        '3--设置属性
        With btnGlobalPrintFinancialSetup
            .Tag = NAV_ITEM_GLOBAL_PRINT_FINANCIALSETUP_TAG  '"ItemGlobalPrintFinancialSetup"
            .Text = NAV_ITEM_GLOBAL_PRINT_FINANCIALSETUP_TEXT  '"全局打印设置"
        End With
        '4--添加按钮点击事件
        AddHandler btnGlobalPrintFinancialSetup.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelFinancialSetup.Controls.Add(btnGlobalPrintFinancialSetup) '06

        '09 - 调整栏目组容器控件panel高度
        panelFinancialSetup.AutoSize = True
        '10 - 设定容器控件的隐藏（折叠）
        panelFinancialSetup.Visible = False

        '********************
        '系统设置：打印设置、备份/恢复数据、修改密码、年度结转、历史数据、切换用户
        '================================================
        '005 - 生成第五个标题按钮 系统设置 6
        '================================================
        '
        '01 - 定义分组布局
        Dim panelSysSetup As FlowLayoutPanel = New FlowLayoutPanel()
        panelSysSetup.Anchor = AnchorStyles.Left Or AnchorStyles.Top
        '02 - 定义标题按钮标签
        Dim btnTitleSysSetup As NavTitleButton = New NavTitleButton()
        '03 - 设置标题按钮标签属性
        With btnTitleSysSetup
            .Text = NAV_TITLE_SYS_SETUP_TEXT '= "系统设置"
            .Image = My.Resources.nav_title_bg_sys_setup  'Image.FromFile(IO.Path.Combine(IO.Path.Combine(sysAppCurrentPath, "pic"), "nav_title_bg_sys_setup.png"))
            .Tag = NAV_TITLE_SYS_SETUP_TAG '"TitleSysSetup"
        End With
        '04 - 添加点击事件
        AddHandler btnTitleSysSetup.Click, AddressOf ShowAndHideGroup
        '05 - 放入词典
        sysBtnTitleDic.Add(NAV_TITLE_SYS_SETUP_TAG, panelSysSetup)
        '06 - 将按钮标题加入到窗体控件中
        Me.FlowLayoutPanel1.Controls.Add(btnTitleSysSetup) ' 001
        '07 - 将布局栏目组控件加入到窗体控件中
        Me.FlowLayoutPanel1.Controls.Add(panelSysSetup)

        '=========================================================
        '08 - 开始添加组内各栏目按钮 共 6 个
        '0801 - 打印设置 栏目
        '1--添加具体按钮 - 打印设置
        Dim btnPrintSetupSysSetup As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_PRINT_SETUP_SYS_SETUP_TAG, GetType(frmSysSetupPrintSetup))
        '3--设置属性
        With btnPrintSetupSysSetup
            .Tag = NAV_ITEM_PRINT_SETUP_SYS_SETUP_TAG  '"ItemPrintSetupSysSetup"
            .Text = NAV_ITEM_PRINT_SETUP_SYS_SETUP_TEXT  '"打印设置"
        End With
        '4--添加按钮点击事件
        AddHandler btnPrintSetupSysSetup.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelSysSetup.Controls.Add(btnPrintSetupSysSetup) '01

        '0802 - 备份/恢复数据 栏目
        '1--添加具体按钮 - 备份/恢复数据
        Dim btnBackupRestoreSysSetup As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_BACKUP_RESTORE_SYS_SETUP_TAG, GetType(frmSysSetupBackupRestore))
        '3--设置属性
        With btnBackupRestoreSysSetup
            .Tag = NAV_ITEM_BACKUP_RESTORE_SYS_SETUP_TAG  '"ItemBackupRestoreSysSetup"
            .Text = NAV_ITEM_BACKUP_RESTORE_SYS_SETUP_TEXT  '"备份/恢复数据"
        End With
        '4--添加按钮点击事件
        AddHandler btnBackupRestoreSysSetup.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelSysSetup.Controls.Add(btnBackupRestoreSysSetup) '02

        '0803 - 修改密码栏目
        '1--添加具体按钮 - 修改密码
        Dim btnModifyPasswordSysSetup As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_MODIFY_PASSWORD_SYS_SETUP_TAG, GetType(frmSysSetupModifyPassword))
        '3--设置属性
        With btnModifyPasswordSysSetup
            .Tag = NAV_ITEM_MODIFY_PASSWORD_SYS_SETUP_TAG  '"ItemModifyPasswordSysSetup"
            .Text = NAV_ITEM_MODIFY_PASSWORD_SYS_SETUP_TEXT  '"修改密码"
        End With
        '4--添加按钮点击事件
        AddHandler btnModifyPasswordSysSetup.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelSysSetup.Controls.Add(btnModifyPasswordSysSetup) '03

        '0804 - 年度结转栏目
        '1--添加具体按钮 - 年度结转
        Dim btnCarryOverSysSetup As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_CARRYOVER_SYS_SETUP_TAG, GetType(frmSysSetupCarryOver))
        '3--设置属性
        With btnCarryOverSysSetup
            .Tag = NAV_ITEM_CARRYOVER_SYS_SETUP_TAG  '"ItemCarryOverSysSetup"
            .Text = NAV_ITEM_CARRYOVER_SYS_SETUP_TEXT  '"年度结转"
        End With
        '4--添加按钮点击事件
        AddHandler btnCarryOverSysSetup.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelSysSetup.Controls.Add(btnCarryOverSysSetup) '04

        '0805 - 历史数据栏目
        '1--添加具体按钮 - 历史数据
        Dim btnHistoryDataSysSetup As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_HISTORY_DATA_SYS_SETUP_TAG, GetType(frmSysSetupHistoryData))
        '3--设置属性
        With btnHistoryDataSysSetup
            .Tag = NAV_ITEM_HISTORY_DATA_SYS_SETUP_TAG  '"ItemHistoryDataSysSetup"
            .Text = NAV_ITEM_HISTORY_DATA_SYS_SETUP_TEXT  '"历史数据"
        End With
        '4--添加按钮点击事件
        AddHandler btnHistoryDataSysSetup.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelSysSetup.Controls.Add(btnHistoryDataSysSetup) '05

        '0806 - 切换用户栏目
        '1--添加具体按钮 - 切换用户
        Dim btnChangeUserSysSetup As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_CHANGE_USER_SYS_SETUP_TAG, GetType(frmSysSetupChangeUser))
        '3--设置属性
        With btnChangeUserSysSetup
            .Tag = NAV_ITEM_CHANGE_USER_SYS_SETUP_TAG  '"ItemChangeUserSysSetup"
            .Text = NAV_ITEM_CHANGE_USER_SYS_SETUP_TEXT  '"切换用户"
        End With
        '4--添加按钮点击事件
        AddHandler btnChangeUserSysSetup.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelSysSetup.Controls.Add(btnChangeUserSysSetup) '06

        '09 - 调整栏目组容器控件panel高度
        panelSysSetup.AutoSize = True
        '10 - 设定容器控件的隐藏（折叠）
        panelSysSetup.Visible = False


    End Sub

    Private Sub LoadSysManageButtonGroup()
        '**************************************************
        '系统管理：账套管理、用户管理、科目转换工具、初始设置、清空总账
        '================================================
        '006 - 生成第六个标题按钮 系统管理
        '================================================
        '
        '01 - 定义分组布局
        Dim panelSysManage As FlowLayoutPanel = New FlowLayoutPanel()
        panelSysManage.Anchor = AnchorStyles.Left Or AnchorStyles.Top
        '02 - 定义标题按钮标签
        Dim btnTitleSysManage As NavTitleButton = New NavTitleButton()
        '03 - 设置标题按钮标签属性
        With btnTitleSysManage
            .Text = NAV_TITLE_SYS_MANAGE_TEXT '= "系统管理"
            .Image = My.Resources.nav_title_bg_sys_manage  'Image.FromFile(IO.Path.Combine(IO.Path.Combine(sysAppCurrentPath, "pic"), "nav_title_bg_sys_manage.png"))
            .Tag = NAV_TITLE_SYS_MANAGE_TAG '"TitleSysSetup"
        End With
        '04 - 添加点击事件
        AddHandler btnTitleSysManage.Click, AddressOf ShowAndHideGroup
        '05 - 放入词典
        sysBtnTitleDic.Add(NAV_TITLE_SYS_MANAGE_TAG, panelSysManage)
        '06 - 将按钮标题加入到窗体控件中
        Me.FlowLayoutPanel1.Controls.Add(btnTitleSysManage) ' 001
        '07 - 将布局栏目组控件加入到窗体控件中
        Me.FlowLayoutPanel1.Controls.Add(panelSysManage)

        '0801 - 账套管理 栏目
        '1--添加具体按钮 - 账套管理
        Dim btnLedgersSysManage As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_LEDGERS_SYS_MANAGE_TAG, GetType(frmSysManageLedgers))
        '3--设置属性
        With btnLedgersSysManage
            .Tag = NAV_ITEM_LEDGERS_SYS_MANAGE_TAG  '"ItemLedgersSysManage"
            .Text = NAV_ITEM_LEDGERS_SYS_MANAGE_TEXT  '"账套管理"
        End With
        '4--添加按钮点击事件
        AddHandler btnLedgersSysManage.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelSysManage.Controls.Add(btnLedgersSysManage) '01

        '0802 - 用户管理 栏目
        '1--添加具体按钮 - 用户管理
        Dim btnUsersSysManage As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_USERS_SYS_MANAGE_TAG, GetType(frmSysManageUsers))
        '3--设置属性
        With btnUsersSysManage
            .Tag = NAV_ITEM_USERS_SYS_MANAGE_TAG  '"ItemUsersSysManage"
            .Text = NAV_ITEM_USERS_SYS_MANAGE_TEXT  '"用户管理"
        End With
        '4--添加按钮点击事件
        AddHandler btnUsersSysManage.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelSysManage.Controls.Add(btnUsersSysManage) '02

        '0803 - 科目转换工具栏目
        '1--添加具体按钮 - 科目转换工具
        Dim btnAcctConvertSysManage As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_ACCT_CONVERT_SYS_MANAGE_TAG, GetType(frmSysManageAcctConvert))
        '3--设置属性
        With btnAcctConvertSysManage
            .Tag = NAV_ITEM_ACCT_CONVERT_SYS_MANAGE_TAG  '"ItemAcctConvertSysManage"
            .Text = NAV_ITEM_ACCT_CONVERT_SYS_MANAGE_TEXT  '"科目转换工具"
        End With
        '4--添加按钮点击事件
        AddHandler btnAcctConvertSysManage.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelSysManage.Controls.Add(btnAcctConvertSysManage) '03

        '0807 - 初始设置栏目
        '1--添加具体按钮 - 初始设置
        Dim btnInitializeSysManage As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_INITIALIZE_SYS_MANAGE_TAG, GetType(frmSysManageInitialize))
        '3--设置属性
        With btnInitializeSysManage
            .Tag = NAV_ITEM_INITIALIZE_SYS_MANAGE_TAG  '"ItemInitializeSysManage"
            .Text = NAV_ITEM_INITIALIZE_SYS_MANAGE_TEXT  '"初始设置"
        End With
        '4--添加按钮点击事件
        AddHandler btnInitializeSysManage.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelSysManage.Controls.Add(btnInitializeSysManage) '04

        '0805 - 清空总账栏目
        '1--添加具体按钮 - 清空总账
        Dim btnClearGeneralLedgerSysManage As NavItemButton = New NavItemButton()
        '2--添加到词典中
        sysBtnItemDic.Add(NAV_ITEM_CLEAR_GENERAL_LEDGER_SYS_MANAGE_TAG, GetType(frmSysManageClearGeneralLedger))
        '3--设置属性
        With btnClearGeneralLedgerSysManage
            .Tag = NAV_ITEM_CLEAR_GENERAL_LEDGER_SYS_MANAGE_TAG  '"ItemClearGeneralLedgerSysManage"
            .Text = NAV_ITEM_CLEAR_GENERAL_LEDGER_SYS_MANAGE_TEXT  '"清空总账"
        End With
        '4--添加按钮点击事件
        AddHandler btnClearGeneralLedgerSysManage.Click, AddressOf OpenButtonItemForm
        '5--添加条目按钮到panel控件组中
        panelSysManage.Controls.Add(btnClearGeneralLedgerSysManage) '05

        '09 - 调整栏目组容器控件panel高度
        panelSysManage.AutoSize = True
        '10 - 设定容器控件的隐藏（折叠）
        panelSysManage.Visible = False
    End Sub

    Private Sub ShowAndHideGroup(sender As Object, e As EventArgs)
        Try
            Dim flowPanel As FlowLayoutPanel '= panelVoucher
            Dim curChecked As Boolean

            Dim tmpBtn As Button = CType(sender, Button)
            Dim tagStr As String = CType(tmpBtn.Tag, String)

            flowPanel = CType(sysBtnTitleDic(tagStr), FlowLayoutPanel)

            If flowPanel Is Nothing Then
                Exit Sub
            End If

            '将当前指定的取出来
            curChecked = flowPanel.Visible

            If Not curChecked Then
                '遍历当前字典'隐藏全部panel
                For Each pK In sysBtnTitleDic.Keys
                    CType(sysBtnTitleDic(pK), FlowLayoutPanel).Visible = False
                Next
            End If

            flowPanel.Visible = Not curChecked

        Catch ex As Exception
            '收集错误信息
            mErrorNumber = ERROR_NUMBER_CONTROL
            mErrorMessage = ex.Message
            mErrorCreater = "frmNavigate - ShowAndHideGroup"
        End Try
    End Sub


    Private Sub OpenButtonItemForm(sender As Object, e As EventArgs)
        '创建并打开对应的窗体
        Try
            '取出按钮，判断是哪个按钮
            Dim tmpItemStr As String = CType(CType(sender, Button).Tag, String)
            Dim tmpForm As Form = Nothing

            Select Case tmpItemStr
                Case NAV_ITEM_INPUT_VOUCHER_TAG '01
                    tmpForm = GenericSingleton(Of FrmVoucherInput).CreateInstance()
                Case NAV_ITEM_EDIT_VOUCHER_TAG '02
                    tmpForm = GenericSingleton(Of frmVoucherEdit).CreateInstance()
                Case NAV_ITEM_CHECKUP_VOUCHER_TAG '03
                    tmpForm = GenericSingleton(Of frmVoucherCheckup).CreateInstance()
                Case NAV_ITEM_DELETE_VOUCHER_TAG '04
                    tmpForm = GenericSingleton(Of frmVoucherDelete).CreateInstance()
                Case NAV_ITEM_INPUTFROMRJCW_VOUCHER_TAG '05
                    tmpForm = GenericSingleton(Of frmVoucherInputFromRJCW).CreateInstance()
                Case NAV_ITEM_LOOKUP_VOUCHER_TAG '06
                    tmpForm = GenericSingleton(Of frmVoucherLookup).CreateInstance()
                Case NAV_ITEM_REPAIR_VOUCHER_TAG '07
                    tmpForm = GenericSingleton(Of frmVoucherRepair).CreateInstance()
                Case NAV_ITEM_BROWSE_VOUCHER_TAG '08
                    tmpForm = GenericSingleton(Of frmVoucherBrowse).CreateInstance()
                Case NAV_ITEM_INPUTFROMEXCEL_VOUCHER_TAG '09
                    tmpForm = GenericSingleton(Of frmVoucherInputFromExcel).CreateInstance()
                Case NAV_ITEM_INPUTGENEXCEL_VOUCHER_TAG '10
                    tmpForm = GenericSingleton(Of frmVoucherGenFromExcel).CreateInstance()
                Case NAV_ITEM_OUTPUTTOEXCEL_VOUCHER_TAG '11
                    tmpForm = GenericSingleton(Of frmVoucherOutpuToExcel).CreateInstance()
                Case NAV_ITEM_POST_VOUCHER_TAG '01 
                    tmpForm = GenericSingleton(Of frmVoucherPost).CreateInstance()
                Case NAV_ITEM_SETTLEMONTH_LEDGER_TAG '02 
                    tmpForm = GenericSingleton(Of frmLedgerSettleMonth).CreateInstance()
                Case NAV_ITEM_UNPOST_LEDGER_TAG '03
                    tmpForm = GenericSingleton(Of frmLedgerUnPost).CreateInstance()
                Case NAV_ITEM_SUMACCOUNT_LEDGER_TAG '04
                    tmpForm = GenericSingleton(Of frmLedgerSumAccount).CreateInstance()
                Case NAV_ITEM_ACCOUNTBALANCE_LEDGER_TAG '05
                    tmpForm = GenericSingleton(Of frmLedgerAccountBalance).CreateInstance()
                Case NAV_ITEM_QUANTITYBALANCE_LEDGER_TAG '06
                    tmpForm = GenericSingleton(Of frmLedgerQuantityBalance).CreateInstance()
                Case NAV_ITEM_FAKEPOST_LEDGER_TAG '07
                    tmpForm = GenericSingleton(Of frmLedgerFakePost).CreateInstance()
                Case NAV_ITEM_INCANDDEC_LEDGER_TAG '08
                    tmpForm = GenericSingleton(Of frmLedgerIncAndDec).CreateInstance()
                Case NAV_ITEM_ACCTDETAIL_REPORT_TAG '01
                    tmpForm = GenericSingleton(Of frmReportAcctDetail).CreateInstance()
                Case NAV_ITEM_GENERALLEDGER_REPORT_TAG '02
                    tmpForm = GenericSingleton(Of frmReportGeneralLedger).CreateInstance()
                Case NAV_ITEM_FINANCIALSTATEMENT_REPORT_TAG '03
                    tmpForm = GenericSingleton(Of frmReportFinancialStatement).CreateInstance()
                Case NAV_ITEM_DEFINEMULTICOLUMN_REPORT_TAG '04
                    tmpForm = GenericSingleton(Of frmReportDefineMultiColumn).CreateInstance()
                Case NAV_ITEM_MULTICOLUMN_REPORT_TAG '05
                    tmpForm = GenericSingleton(Of frmReportMultiColumn).CreateInstance()
                Case NAV_ITEM_COMBOCOLUMN_REPORT_TAG '06
                    tmpForm = GenericSingleton(Of frmReportComboColumn).CreateInstance()
                Case NAV_ITEM_ACCT_FINANCIALSETUP_TAG '01
                    tmpForm = GenericSingleton(Of frmFinancialSetupAcct).CreateInstance()
                Case NAV_ITEM_INPUT_ACCT_FINANCIALSETUP_TAG '02
                    tmpForm = GenericSingleton(Of frmFinancialSetupInputAcct).CreateInstance()
                Case NAV_ITEM_REPAIR_ACCT_FINANCIALSETUP_TAG '03
                    tmpForm = GenericSingleton(Of frmFinancialSetupRepairAcct).CreateInstance()
                Case NAV_ITEM_SPECIAL_PROJECT_FINANCIALSETUP_TAG '04
                    tmpForm = GenericSingleton(Of frmFinancialSetupSepcialProject).CreateInstance()
                Case NAV_ITEM_VOUCHER_TYPE_FINANCIALSETUP_TAG '05
                    tmpForm = GenericSingleton(Of frmFinancialSetupVoucherType).CreateInstance()
                Case NAV_ITEM_GLOBAL_PRINT_FINANCIALSETUP_TAG '06
                    tmpForm = GenericSingleton(Of frmFinancialSetupGlobalPrint).CreateInstance()
                Case NAV_ITEM_PRINT_SETUP_SYS_SETUP_TAG '01
                    tmpForm = GenericSingleton(Of frmSysSetupPrintSetup).CreateInstance()
                Case NAV_ITEM_BACKUP_RESTORE_SYS_SETUP_TAG '02
                    tmpForm = GenericSingleton(Of frmSysSetupBackupRestore).CreateInstance()
                Case NAV_ITEM_MODIFY_PASSWORD_SYS_SETUP_TAG '03
                    tmpForm = GenericSingleton(Of frmSysSetupModifyPassword).CreateInstance()
                Case NAV_ITEM_CARRYOVER_SYS_SETUP_TAG '04
                    tmpForm = GenericSingleton(Of frmSysSetupCarryOver).CreateInstance()
                Case NAV_ITEM_HISTORY_DATA_SYS_SETUP_TAG '05
                    tmpForm = GenericSingleton(Of frmSysSetupHistoryData).CreateInstance()
                Case NAV_ITEM_CHANGE_USER_SYS_SETUP_TAG '06
                    tmpForm = GenericSingleton(Of frmSysSetupChangeUser).CreateInstance()
                Case NAV_ITEM_LEDGERS_SYS_MANAGE_TAG '01
                    tmpForm = GenericSingleton(Of frmSysManageLedgers).CreateInstance()
                Case NAV_ITEM_USERS_SYS_MANAGE_TAG '02
                    tmpForm = GenericSingleton(Of frmSysManageUsers).CreateInstance()
                Case NAV_ITEM_ACCT_CONVERT_SYS_MANAGE_TAG '03
                    tmpForm = GenericSingleton(Of frmSysManageAcctConvert).CreateInstance()
                Case NAV_ITEM_INITIALIZE_SYS_MANAGE_TAG '04
                    tmpForm = GenericSingleton(Of frmSysManageInitialize).CreateInstance()
                Case NAV_ITEM_CLEAR_GENERAL_LEDGER_SYS_MANAGE_TAG '05
                    tmpForm = GenericSingleton(Of frmSysManageClearGeneralLedger).CreateInstance()
            End Select

            If tmpForm IsNot Nothing Then
                With tmpForm
                    .MdiParent = sysFrmMdiMain
                    .StartPosition = FormStartPosition.CenterScreen
                    .Show()
                End With
            End If

        Catch ex As Exception
            '收集错误信息
            mErrorNumber = ERROR_NUMBER_CONTROL
            mErrorMessage = ex.Message
            mErrorCreater = "frmNavigate - ShowAndHideGroup"
        End Try
    End Sub

    Private Sub frmNavigate_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
        '如果不是父窗体要关闭，则取消关闭
        'If e.closereason <> MdiFormClosing Then
        Dim eExit As FormClosingEventArgs

        If TypeOf e Is FormClosingEventArgs Then
            eExit = CType(e, FormClosingEventArgs)
            If eExit.CloseReason <> CloseReason.MdiFormClosing Then
                e.Cancel = True
                '隐藏自己
                Me.Visible = False

            End If
        End If

        'End If
    End Sub
End Class